package com.lv.fast.DTO;

import com.lv.fast.model.ExtendBean;
import com.lv.fast.valid.group.AddStrategy;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.util.LinkedHashSet;

/**
 * @Description
 * @Author jie.lv
 */
@Data
@ApiModel("角色对象")
public class SysRoleDTO extends ExtendBean {

    @ApiModelProperty(value = "角色名称",example = "管理员")
    @NotBlank(message = "角色名称不能为空", groups = {AddStrategy.class})
    @Length(min = 2, max = 20, message = "角色名称2-20个字符")
    private String name;

    @ApiModelProperty(value = "角色描述",example = "后台系统管理员拥有所有角色")
    @NotBlank(message = "角色描述不能为空", groups = {AddStrategy.class})
    @Length(min = 2, max = 50, message = "角色描述2-50个字符")
    private String roleDescribe;

    @ApiModelProperty(value = "菜单集合",example = "[{\"id\":\"1\"},{\"id\":\"2\"}]")
    private LinkedHashSet<SysMenuDTO> menus;
}
